﻿using Beryl.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Description;
using System.Web.WebSockets;

namespace Beryl
{
    /// <summary>
    /// WebService1 的摘要说明
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务，请取消注释以下行。 
    // [System.Web.Script.Services.ScriptService]
    public class WebService1 : System.Web.Services.WebService
    {

        DBOperation dbOperation = new DBOperation();

        [WebMethod]
        public string[] HelloWorld(string Check)
        {
            List<string> list = new List<string>();
            list.Add("OK");
            return list.ToArray();
        }

        //[WebMethod(Description = "查询用户")]
        //public string[] SelectAllCargoInfor(string User)
        //{
        //    return SystemController.Instance.selectAllCargoInfor(User).ToArray();
        //}

        [WebMethod(Description = "增加一条货物信息")]
        public bool insertCargoInfo(string Cname, int Cnum)
        {
            return dbOperation.insertCargoInfo(Cname, Cnum);
        }

        [WebMethod(Description = "删除一条货物信息")]
        public bool deleteCargoInfo(string Cno)
        {
            return dbOperation.deleteCargoInfo(Cno);
        }

        //[WebMethod(Description ="查询barcode")]
        //public string[] selectBarCode(string barcode)
        //{
        //    List<string> list = new List<string>();
        //    list.Add(dbOperation.selectbarCode(barcode));
        //    return list.ToArray();
        //}

        [WebMethod(Description = "增加一条货物信息1")]
        public bool insertCargoInfo1(string Cname, string Cnum)
        {
            return dbOperation.insert1(Cname, Cnum) ;
        }

        //[WebMethod(Description = "查找刀具信息")]
        //public string[] selectgetKn(string Kn)
        //{
        //    List<string> list = new List<string>();
        //    list.Add(dbOperation.selectgetKn(Kn));
        //    return list.ToArray();
        //}

        //[WebMethod(Description = "查找设备信息")]
        //public string[] selectgetEQ(string EQ)
        //{
        //    List<string> list = new List<string>();
        //    list.Add(dbOperation.selectgetEQ(EQ));
        //    return list.ToArray();
        //}

        //[WebMethod(Description = "查找人员信息")]
        //public string[] selectgetPr(string Pr)
        //{
        //    List<string> list = new List<string>();
        //    list.Add(dbOperation.selectgetPr(Pr));
        //    return list.ToArray();
        //}

        //[WebMethod(Description ="裁切开工记录提交")]
        //public string[] Summit(string summit)
        //{
        //    List<string> list = new List<string>();
        //    list.Add(dbOperation.summit(summit));
        //    return list.ToArray();
        //}

        //[WebMethod(Description = "裁切报工")]
        //public string[] getCaiQie(string data)
        //{
        //    return dbOperation.getCaiQie(data).ToArray();
        //}

        //[WebMethod(Description = "裁切报工提交")]
        //public string[] summitCQ(string data)
        //{
        //    List<string> list = new List<string>();
        //    list.Add(dbOperation.summitCQ(data));
        //    return list.ToArray();
        //}

        //[WebMethod(Description = "裁切接收查询")]
        //public string[] getCQReV(string data)
        //{
        //    return dbOperation.getCQReV(data).ToArray();
        //}

        //[WebMethod(Description = "裁切接收提交")]
        //public string[] summitCQReV(string data)
        //{
        //    List<string> list = new List<string>();
        //    list.Add(dbOperation.summitCQReV(data));
        //    return list.ToArray();
        //}

    }
}
